package org.vison.wonfu.framework.soa.protocol;

import org.vison.wonfu.framework.soa.Invocation;
import org.vison.wonfu.framework.soa.annotation.SoaRef;
import org.vison.wonfu.framework.soa.discovery.ServiceInstance;
import org.vison.wonfu.framework.soa.exception.RpcException;

import java.lang.reflect.Method;

public interface SoaRefInvocationHandler {

    Invocation buildInvocation(Method method, SoaRef soaRef, Object[] args) throws RpcException;

    ServiceInstance selectServiceInstance(SoaRef soaRef);

    Object doInvokeConsumer(Invocation invocation) throws Throwable;

    Object handleFallback(Invocation invocation);


}
